﻿// <copyright file="PersistenceModule.cs" company="Ecole Normale Supérieure">
// Released under GPLv2
// </copyright>
// <summary>Contains the PersistenceModule</summary>

namespace Sqwarea.Persistence.Azure
{
    using Autofac.Builder;

    /// <summary>
    /// Autofac module for registering Persistence class for Web Role
    /// </summary>
    public class PersistenceModule : Module
    {
        /// <summary>
        /// Register Persistence modules.
        /// </summary>
        /// <param name="moduleBuilder">See Autofac documentation.</param>
        protected override void Load(ContainerBuilder moduleBuilder)
        {
            moduleBuilder.Register<GameProvider>().As<IGameProvider>().SingletonScoped();
            moduleBuilder.Register<GlobalVariables>().As<IGlobalVariables>().SingletonScoped();
            moduleBuilder.Register<LogProvider>().As<ILogProvider>().SingletonScoped();
            moduleBuilder.Register<QueueProvider>().As<IQueueProvider>().SingletonScoped();
            moduleBuilder.Register<UserProvider>().As<IUserProvider>().SingletonScoped();
            moduleBuilder.Register<BestKingsProvider>().As<IBestKingsProvider>().SingletonScoped();
        }
    }
}
